import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ACLGuard } from '@delon/acl';
import { AcademyViewComponent } from 'src/app/project/component/icm-base/academy/academy-view.component';
import { ProfessionViewComponent } from 'src/app/project/component/icm-base/profession/profession-view.component';
import { ClassViewComponent } from 'src/app/project/component/icm-base/class/class-view.component';
import { CourseTypeViewComponent } from 'src/app/project/component/icm-base/course-type/course-type-view.component';
import { CourseViewComponent } from 'src/app/project/component/icm-base/course/course-view.component';

const routes: Routes = [
  {
    path: 'academy',
    canActivate: [ACLGuard],
    component: AcademyViewComponent,
    data: {
      title: '学院管理',
      reuse: true,
    },
  },
  {
    path: 'profession',
    canActivate: [ACLGuard],
    component: ProfessionViewComponent,
    data: {
      title: '专业管理',
      reuse: true,
    },
  },
  {
    path: 'class',
    canActivate: [ACLGuard],
    component: ClassViewComponent,
    data: {
      title: '班级管理',
      reuse: true,
    },
  },
  {
    path: 'course-type',
    canActivate: [ACLGuard],
    component: CourseTypeViewComponent,
    data: {
      title: '课程类型管理',
      reuse: true,
      guard: {
        role: ['ROLE_SENATOR'],
      },
    },
  },
  {
    path: 'course',
    canActivate: [ACLGuard],
    component: CourseViewComponent,
    data: {
      title: '课程管理',
      reuse: true,
    },
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class BaseRoutingModule {}
